﻿using Gateway.Domain.EFCore.Configuration;
using Gateway.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Gateway.Domain.Configuration;

public class QuestionConfiguration : AggregateRootEntityConfiguration<Question>
{
    public override void Configure(EntityTypeBuilder<Question> builder)
    {
        builder.ToTable(t => t.HasComment("试题表"));
        builder.Property(x => x.QuestionName).HasMaxLength(500).IsRequired().HasComment("试题名称");
        builder.Property(x => x.QuestionDescribe).HasComment("试题描述");
        builder.Property(x => x.QuestionCase).HasMaxLength(1000).HasComment("测试用例");
        base.Configure(builder);
    }
}